import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";

const routes = [
  {
    path: "/",
    name: "Index",
    component: () => import("@/layout/index.vue"),
    redirect: "/home",
    children: [
      {
        path: "/home",
        name: "Home",
        component: () => import("@/views/home/homeIndex.vue"),
      },
      {
        path: "/search",
        name: "Search",
        component: () => import("@/views/home/components/search.vue"),
      },
      {
        path: "/culture",
        name: "Culture",
        component: () => import("@/views/culture/cultureIndex.vue"),
      },
      {
        path: "/detail",
        name: "Detail",
        component: () => import("@/views/common/page/detail.vue"),
      },
      {
        path: "/celebrity",
        name: "Celebrity",
        component: () => import("@/views/celebrity/celebrityIndex.vue"),
      },
      {
        path: "/achievements",
        name: "Achievements",
        component: () => import("@/views/achievements/achievementsIndex.vue"),
      },
      {
        path: "/ancestralHall",
        name: "AncestralHall",
        component: () => import("@/views/ancestralHall/ancestralHallIndex.vue"),
      },
      {
        path: "/selectPayTribute",
        name: "SelectPayTribute",
        component: () =>
          import("@/views/ancestralHall/page/selectPayTribute.vue"),
      },
      {
        path: "/contribution",
        name: "Contribution",
        component: () => import("@/views/ancestralHall/page/contribution.vue"),
      },
      {
        path: "/settlement",
        name: "Settlement",
        component: () => import("@/views/ancestralHall/page/settlement.vue"),
      },
      {
        path: "/submit",
        name: "Submit",
        component: () => import("@/views/ancestralHall/page/submit.vue"),
      },
      {
        path: "/announcement",
        name: "Announcement",
        component: () => import("@/views/announcement/announcementIndex.vue"),
      },
      {
        path: "/news",
        name: "News",
        component: () => import("@/views/news/newsIndex.vue"),
      },
      {
        path: "/genealogyInquiry",
        name: "GenealogyInquiry",
        component: () =>
          import("@/views/genealogyInquiry/genealogyInquiryIndex.vue"),
      },
      {
        path: "/relation",
        name: "Relation",
        component: () => import("@/views/genealogyInquiry/page/relation.vue"),
      },
      {
        path: "/donation",
        name: "Donation",
        component: () => import("@/views/donation/donationIndex.vue"),
      },
      {
        path: "/confirmDonation",
        name: "ConfirmDonation",
        component: () => import("@/views/donation/confirmDonation.vue"),
      },
    ],
  },
];

export const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
